// ----------------------
//1、思路:从一下可以得处，any交上任何类型都是any
type A10 = 1 & any; //any
type A11 = 1 & {}; //1
type A12 = 1 & unknown; //1

type IsAny<T> = 0 extends T & 1 ? true : false;

type A = IsAny<string>; // false
type B = IsAny<any>; // true
type C = IsAny<unknown>; // false
type D = IsAny<never>; // false

//2、思路：通过一下思路得出：unknown extends 类型=true的，类型只能是 any / unknown
type X = unknown extends "3" ? true : false; //false
type X1 = unknown extends 3 ? true : false; //false
type Xa = unknown extends unknown ? true : false; //true
type Xa1 = unknown extends any ? true : false; //true

//unknown extends T 返回true的只能是any\unknown;([T] extends ["333"]具体判断是any还是unknown
type IsAny1<T> = unknown extends T
  ? [T] extends ["333"]
    ? true
    : false
  : false;

//怎么区分any/unknown
type S1 = any extends "333" ? true : false; //boolean
type S2 = unknown extends "333" ? true : false; //false

type A1 = IsAny1<string>; // false
type B1 = IsAny1<any>; // true
type C1 = IsAny1<unknown>; // false
type D1 = IsAny1<never>; // false

export {};
